Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update the doc for how to write the operators. #3873

Merged
merged 3 commits into from
Sep 6, 2017

Conversation

lcy-seso
Copy link
Contributor

@lcy-seso lcy-seso commented Sep 5, 2017

  1. 之前部分代码段没有设置格式,所以没有启用高亮。
  2. 编译方式发生变化。
  3. CMakeLists.txt 一部分是按照 *_op.cc 这样的命名方式来添加源码,按照自己理解修改了一些。


下面命令可以编译:

无需修改[paddle/operators/CMakeLists.txt](/~https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/operators/CMakeLists.txt)文件,`paddle/operators` 目录下新增的 `*_op.cc` 文件会被自动加入编译。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果是DEPS的op,需要改cmakelists.txt。不过cmake这块还在修改和完善,这里先这样写着也可以。或者说明一下:没有DEPS的op自动加入编译。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. thank you.

@@ -310,7 +297,7 @@ class TestMulOp(unittest.TestCase):
- 第四个参数`"Out"` : 指定前向网络最终的输出目标变量`Out`


### 编译和执行
### 编译和执行
Copy link
Contributor

@qingqing01 qingqing01 Sep 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

下面308行,能否帮忙改成:

编译时需要打开WITH_TESTING, 即 cmake paddle_dir -DWITH_TESTING=ON,请注意,运行单测时的需要编译整个工程,不同于上述Op的编译测试,编译成功之后执行单测命令为:

主要是为了和Op里的编译测试区分开,上述Op里编译,可以只编译单独的一个文件,方便测试。 这里Python测试需要生成core.so,需要编译整个工程。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lcy-seso lcy-seso merged commit c107512 into PaddlePaddle:develop Sep 6, 2017
@lcy-seso lcy-seso deleted the update_doc branch September 6, 2017 11:03
heavengate pushed a commit to heavengate/Paddle that referenced this pull request Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants